package com.heima.wemedia;


import com.heima.common.aliyun.GreenImageScan;
import com.heima.common.aliyun.GreenTextScan;
import com.heima.file.service.FileStorageService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Arrays;
import java.util.Map;

@SpringBootTest(classes = WemediaApplication.class)
public class GreenTest21 {

    @Autowired
    private GreenTextScan greenTextScan;
    @Autowired
    private GreenImageScan greenImageScan;
    @Autowired
    private FileStorageService fileStorageService;

    /*文本测试*/
    @Test
    public void test1() throws Exception {
        Map map = greenTextScan.greeTextScan("我是一个好人, 病毒, 冰毒");
        System.out.println(map);
    }

    /*照片测试*/
    @Test
    public void test2() throws Exception {
        byte[] bytes = fileStorageService.downLoadFile("http://192.168.200.130:9000/leadnews/2022/12/30/ac0816ad2afa4277bddf69237a234971.png");
        Map map = greenImageScan.imageScan(Arrays.asList(bytes));
        System.out.println(map);
    }

}
